package cate.common.table.activity.heroup.call;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cate.common.table.item.hero.StarGroupList;
import com.fasterxml.jackson.annotation.JsonIgnore;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass(value = "英雄上新活动-召唤")
public class HeroUpCallRow extends ERow {
    @NoteField(value = "配置ID")
    public int confId;

    @NoteField(value = "召唤类型")
    public int callType;

    @NoteField(value = "英雄ID")
    public int heroId;
    @NoteField(value = "增加的权重值")
    public int rate;

    @NoteField(value = "进度奖励分组")
    public int rewardGroup;


    @NoteField(value = "召唤次数")
    public int callTimes;
    @NoteField(value = "免费次数上限")
    public int freeMax;
    @NoteField(value = "消耗道具")
    public String costPropId;
    @NoteField(value = "消耗钻石")
    public String costM1Str;
    @NoteField(value = "今日钻石召唤次数上限")
    public int diaCallTime;
    @NoteField(value = "元宝送经验")
    public String rewardExpStr;
    @NoteField(value = "星组")
    public String groupStr;

    @NoteField(value = "获得五星限制开启")
    public boolean limitFiveMark;

    @NoteField(value = "召唤五星次数上限")
    public int limitFiveTimes;

    @NoteField(value = "替换星组")
    public int replaceGroup;



    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        this.id = xrw.getInteger("ID");
        this.callType = xrw.getInteger("类型");
        this.confId = xrw.getInteger("配置ID");
        this.rate = xrw.getInteger("增加权重值");
        this.heroId = xrw.getInteger("英雄ID");
        this.rewardGroup = xrw.getInteger("进度奖励分组");
        this.costPropId = xrw.getString("消耗道具", "");
        this.costM1Str = xrw.getString("消耗钻石");
        this.callTimes = xrw.getInteger("召唤次数");
        this.diaCallTime = xrw.getInteger("今日钻石召唤次数上限");
        this.freeMax = xrw.getInteger("免费次数上限", 0);
        this.rewardExpStr = xrw.getString("元宝送经验");
        this.groupStr = xrw.getString("星组");
        this.limitFiveMark = xrw.getBoolean("获得五星限制开启", false);
        this.limitFiveTimes = xrw.getInteger("召唤五星次数上限", 999);
        this.replaceGroup = xrw.getInteger("替换星组", 4);
    }

    @JsonIgnore
    public StarGroupList config = new StarGroupList();

    @Override
    public void decode() {
        config.parse(groupStr);
    }
}
